require 'gserver'

class MyServer < GServer
  def initialize(port, file, *args)
    super(port, *args)
    File.open(file,"r") do |f|
      @lines = f.read
    end
  end

  def serve(io)
    begin

      io.puts(@lines)
    end
  rescue Exception=>e
    io.puts e
  end
end

server = MyServer.new(10000,"./cviceni4/server.out")
server.audit();
puts "Starting server..."
server.start
server.join()
puts "konec"